<?php
$this->menu = array(
    array('label' => Yii::t('app', 'Manage ') . ' ' . $model->label(), 'url' => array('admin')),
);
?>
<h3><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?></h3>
<?php Yii::app()->clientScript->registerScript('search', "
    $('#exportToExcel').click(function(){
    $.fn.yiiGridView.update('order-grid', {
            data: $(this).serialize()
        });
    if($('#from_date').val()!='' && $('#to_date').val()!=''){
     $('#errorMsg').text('');
        window.location = '" . $this->createUrl('admin') . "?' + $(this).parents('form').serialize() + '&export=true';
        return false;}else {
        $('#errorMsg').text('Please select date  from and to.');}
    });
   
"); ?>

<div class="search-form" style="display:block;float: right;">
    <?php $this->renderPartial('_search', array('model' => $model)); ?>
</div><!-- search-form -->
<div style="clear:both;"></div>

<?php
$this->widget('application.components.widgets.tlbExcelView', array(
    'id' => 'order-grid',
    'dataProvider' => $model->customeSearch(),
    'grid_mode' => $production, // Same usage as EExcelView v0.33
     //'filter' => $model,
    //'template'           => "{summary}\n{items}\n{exportbuttons}\n{pager}",
    'title' => 'Skillhipp.com - ' . date('d-m-Y - H-i-s'),
    'creator' => 'Skillhipp.com',
    'subject' => mb_convert_encoding('Something important with a date in French: ' . utf8_encode(strftime('%e %B %Y')), 'ISO-8859-1', 'UTF-8'),
    'description' => mb_convert_encoding('Etat de production généré à la demande par l\'administrateur (some text in French).', 'ISO-8859-1', 'UTF-8'),
    'lastModifiedBy' => 'Skillhipp.com',
    'sheetTitle' => 'Report on ' . date('Y-m-d'),
    'keywords' => '',
    'category' => '',
    'landscapeDisplay' => true, // Default: false
    'A4' => true, // Default: false - ie : Letter (PHPExcel default)
    'pageFooterText' => '&RThis is page no. &P of &N pages', // Default: '&RPage &P of &N'
    'automaticSum' => true, // Default: false
    'decimalSeparator' => ',', // Default: '.'
    'thousandsSeparator' => '.', // Default: ','   
    'sumLabel' => 'Column totals:', // Default: 'Totals'
    'borderColor' => '000', // Default: '000000'
    'bgColor' => 'FFFFFF', // Default: 'FFFFFF'
    'textColor' => '000000', // Default: '000000'
    'rowHeight' => 45, // Default: 15
    'headerBorderColor' => 'FF0000', // Default: '000000'
    'headerBgColor' => 'CCCCCC', // Default: 'CCCCCC'
    'headerTextColor' => '0000FF', // Default: '000000'
    'headerHeight' => 50, // Default: 20
    'footerBorderColor' => '0000FF', // Default: '000000'
    'footerBgColor' => '00FFCC', // Default: 'FFFFCC'
    'footerTextColor' => 'FF00FF', // Default: '0000FF'
    'footerHeight' => 50, // Default: 20
    'zoomScale' => 100, // Default: 100
    'columns' => $coulmn // an array of your CGridColumns
));
?>